package service

import (
	"context"
	v1 "qiyu-contact/api/user/v1"
)

type IUserService interface {
	Login(ctx context.Context, req *v1.LoginReq) (res *v1.UserDetailRes, err error)
	Register(ctx context.Context, req *v1.RegisterReq) (res *v1.RegisterRes, err error)
	FindUserAccount(ctx context.Context, req *v1.FindUserAccountReq) (res *v1.FindUserAccountRes, err error)
	FindUserFriend(ctx context.Context, req *v1.GetUserFriendReq) (res *v1.GetUserFriendRes, err error)
	GetUserDetail(ctx context.Context, req *v1.GetUserDetailReq) (res *v1.GetUserDetailRes, err error)
}

var localUser IUserService

func User() IUserService {
	if localUser == nil {
		panic("IUserService接口未实现或未注册")
	}
	return localUser
}
func RegisterUser(userService IUserService) {
	localUser = userService
}
